package org.newtech.objectgrid.examples;

import java.io.Serializable;

import java.util.Date;
import java.util.List;

import com.ibm.websphere.projector.annotations.CascadeType;

import com.ibm.websphere.projector.annotations.Entity;
import com.ibm.websphere.projector.annotations.Id;
import com.ibm.websphere.projector.annotations.OneToMany;
import com.ibm.websphere.projector.annotations.OneToOne;
import com.ibm.websphere.projector.annotations.OrderBy;

import com.ibm.websphere.objectgrid.em.annotations.Index;

@Entity
public class Order implements Serializable
{
    @Id
    String orderNumber;
    @Index
    Date orderDate;
    int orderStatus;
    int paymentMethod;
    String cardCompany;
    String cardNumber;
    String cardExpiration;
    @OneToOne(cascade=CascadeType.PERSIST)
    Customer customer;
    @OneToMany(cascade=CascadeType.ALL, mappedBy="order") 
    List<OrderItem> items;
}
